package pack0812;

public class Work13 {
    //15：<u>有一篇文章，共10行，每行有80个字符。编写程序，
    //小写字母、数字、 统计其中大写字母、空格及其它字符各有多少个。（二维数组）
    //13：某班期终考试有六门课程，编写程序计算每门课程的平均成绩。
    // 进一步考虑全年级10个班的情况。（二维数组）
    /*int[][] array = {{85,65,75,45,65,85},
            {95,25,65,85,33,45},
            {63,85,74,96,58,47},
            {56,85,95,87,85,47},
            {56,85,45,65,25,},
            {95,85,65,47,58,87}
            };
    double[] arr = new double[6];
    public void num(){
        for(int i = 0; i<array.length; i++){
            int a = 0;
            for(int j = 0; j<array[i].length;j++){
                a += array[i][j];
            }
            arr[i] = (double)a/array[i].length;
        }
        print();
    }
    public void print(){
        for(int i = 0; i<array.length; i++){
            System.out.println(arr[i]);
        }
    }

    public static void main(String[] args) {
        Work13 bd = new Work13();
        bd.num();
    }*/
    int[][][] array = {{{85,65,75,45,65,85}, {95,25,65,85,33,45}, {63,85,74,96,58,47}, {56,85,95,87,85,47}, {56,85,45,65,25,}, {95,85,65,47,58,87}},
            {{88,65,75,45,65,85}, {96,25,65,85,33,45}, {68,85,74,96,58,47}, {57,85,95,87,85,47}, {57,85,45,65,25,}, {75,85,65,47,58,87}},
            {{82,67,75,45,65,85}, {95,22,65,85,33,45}, {63,75,74,96,58,47}, {56,86,95,87,85,47}, {56,88,45,65,25,}, {95,65,65,47,58,87}},
            {{85,65,74,45,65,85}, {95,25,67,85,33,45}, {63,85,79,96,58,47}, {56,85,97,87,85,47}, {56,85,55,65,25,}, {95,85,67,47,58,87}},
            {{85,65,75,43,65,85}, {95,25,65,84,33,45}, {63,85,74,94,58,47}, {56,85,95,83,85,47}, {56,85,45,68,25,}, {95,85,65,87,58,87}},
            {{85,65,75,45,62,85}, {95,25,65,85,73,45}, {63,85,74,96,53,47}, {56,85,95,87,82,47}, {56,85,45,65,75,}, {95,85,65,47,88,87}},
            {{85,65,75,44,65,85}, {95,25,65,85,33,85}, {63,85,74,96,58,77}, {56,85,95,87,85,41}, {56,85,45,69,25,}, {95,85,65,47,58,67}},
            {{85,65,72,45,65,85}, {95,25,65,85,63,45}, {63,85,74,96,68,47}, {56,85,95,87,87,47}, {56,85,75,65,25,}, {95,85,65,47,78,87}},
            {{85,61,75,45,65,85}, {95,25,65,25,33,45}, {63,85,74,76,58,47}, {56,85,95,86,85,47}, {56,65,45,65,25,}, {95,85,65,97,58,87}},
            {{88,65,75,45,65,85}, {95,25,85,85,33,45}, {63,85,79,96,58,47}, {56,85,97,87,85,47}, {86,85,45,65,25,}, {95,85,67,47,58,87}}
            };
    int[][] arr = new int[10][6];
    public void num(){
        for(int o = 0; o<array.length;o++){
            for(int i = 0; i<array[o].length; i++){
                int a = 0;
                for(int j = 0; j<array[o][i].length;j++){
                    a += array[o][i][j];
                }
                arr[o][i] = a/array[o][i].length;
            }
        }
        print();
    }
    public void print(){
        for(int o = 0; o<arr.length; o++){
            for(int i = 0; i<arr[o].length; i++){
                System.out.print(arr[o][i]+"\t");
            }
            System.out.println();
        }
    }

    public static void main(String[] args) {
        Work13 bd = new Work13();
        bd.num();
    }

}

